/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package session;

import entidades.Servicio;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.Persistence;
import javax.persistence.PersistenceContext;

/**
 *
 * @author SergioAlberto
 */
@Stateless
public class ServicioFacade extends AbstractFacade<Servicio> implements ServicioFacadeLocal {
    @PersistenceContext(unitName = "TeLoReparo-ejbPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public ServicioFacade() {
        super(Servicio.class);
        if(this.em == null){
            this.em = Persistence.createEntityManagerFactory("TeLoReparo-ejbPU").createEntityManager();
        }
    }
    
}
